<template>
  <div>
    <el-upload
      ref="uploadRef"
      action=""
      :auto-upload="false"
      :show-file-list="true"
      v-model:file-list="fileList"
    >
      <template #trigger>
        <el-button type="primary">选择文件</el-button>
      </template>
      <el-button class="ml-3" type="success" @click="submitUpload"> 上传 </el-button>
    </el-upload>
  </div>
</template>

<script setup>
import { reactive, ref } from 'vue' 

const fileList = ref([]) 
 

const submitUpload = async () => {
  if (!fileList.value.length) {
    ElMessage.warning('请选择文件')
    return
  }
  console.log(fileList.value)
 
}
 
</script>

<style scoped></style>
